package com.platform.enums;

import com.platform.comm.enums.BaseEnum;
import lombok.Getter;

/**
 * @author zhangqian
 */
public enum OptLogType implements BaseEnum<String> {

    /**
     * 操作类型
     */
    WRONG_BATCH_DEL("WRONG_BATCH_DEL", "错误数据批量删除"),
    QUE_BATCH_DEL("QUE_BATCH_DEL", "交换错误数据批量删除"),
    TOAUDIT_BATCH_DEL("TOAUDIT_BATCH_DEL", "待审核数据批量删除"),
    INSPECT_BATCH_DEL("INSPECT_BATCH_DEL", "质检失败数据批量删除"),


    WRONG_DEL("WRONG_DEL", "错误数据删除"),
    QUE_DEL("QUE_DEL", "交换错误数据删除"),
    TOAUDIT_DEL("TOAUDIT_DEL", "待审核数据删除"),
    INSPECT_DEL("INSPECT_DEL", "质检失败数据删除"),


    WRONG_DOWN("WRONG_DOWN", "错误数据下载"),
    QUE_DOWN("QUE_DOWN", "交换错误数据下载"),
    TOAUDIT_DOWN("TOAUDIT_DOWN", "待审核数据下载"),
    INSPECT_DOWN("INSPECT_DOWN", "质检失败数据下载"),


    wrongData("wrongData", "错误数据"),
    questionData("questionData", "交换错误数据"),
    toAuditData("toAuditData", "待审核数据"),
    inspectData("inspectData", "质检失败数据"),
    commonData("commonData", "正常数据"),

    WRONG_("WRONG_", "错误数据操作记录"),
    QUE_("QUE_", "疑问数据操作记录"),
    TOAUDIT_("TOAUDIT_", "待审核数据操作记录"),
    INSPECT_("INSPECT_", "质检失败数据操作记录");


    @Getter
    private final String code;
    @Getter
    private final String text;


    OptLogType(String code, String text) {
        this.code = code;
        this.text = text;
    }

    @Override
    public String getValue() {
        return text;
    }

    public String getCode() {
        return code;
    }

    public static String getTextByCode(String code) {
        if (code.equals(WRONG_BATCH_DEL.code)) {
            return WRONG_BATCH_DEL.text;
        } else if (code.equals(QUE_BATCH_DEL.code)) {
            return QUE_BATCH_DEL.text;
        } else if (code.equals(TOAUDIT_BATCH_DEL.code)) {
            return TOAUDIT_BATCH_DEL.text;
        } else if (code.equals(INSPECT_BATCH_DEL.code)) {
            return INSPECT_BATCH_DEL.text;
        }
        if (code.equals(WRONG_DEL.code)) {
            return WRONG_DEL.text;
        } else if (code.equals(QUE_DEL.code)) {
            return QUE_DEL.text;
        } else if (code.equals(TOAUDIT_DEL.code)) {
            return TOAUDIT_DEL.text;
        } else if (code.equals(INSPECT_DEL.code)) {
            return INSPECT_DEL.text;
        } else {
            return null;
        }
    }
}
